package test.aop.interceptor;


import com.why.simpleboot.core.core.aop.entity.MethodInvocation;
import com.why.simpleboot.core.core.aop.interceptor.Interceptor;

/**
 * 全局拦截器
 **/
public class GlobalInterceptor extends Interceptor {
    @Override
    public Object proceed(MethodInvocation methodInvocation) {
        System.out.println(GlobalInterceptor.class.getSimpleName() + " before method：" +
                methodInvocation.getMethod().getName());
        Object result = methodInvocation.invoke();
        System.out.println(GlobalInterceptor.class.getSimpleName() + " after method：" +
                methodInvocation.getMethod().getName());
        return result;
    }

}
